//
//  Setting_InviteColleagueTableViewCell.m
//  fxxiaoke
//
//  Created by 鞠超 on 16/9/18.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "Setting_InviteColleagueTableViewCell.h"

@implementation Setting_InviteColleagueTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.image_icon = [[UIImageView alloc] init];
    [self.contentView addSubview:self.image_icon];
    
    self.lbl_name = [[UILabel alloc] init];
    self.lbl_name.font = [UIFont systemFontOfSize:17.0];
    [self.contentView addSubview:self.lbl_name];
    
    self.lbl_detail = [[UILabel alloc] init];
    self.lbl_detail.font = [UIFont systemFontOfSize:15.0f];
    self.lbl_detail.textAlignment = NSTextAlignmentRight;
    self.lbl_detail.textColor = [UIColor grayColor];
    [self.contentView addSubview:self.lbl_detail];
    
    self.view_Line = [[UIView alloc] init];
    self.view_Line.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.view_Line];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.image_icon.frame = CGRectMake(15, 10, 30, 30);
    
    CGFloat length_x = (SCREEN_WIDTH - 75) / 2;
    
    self.lbl_name.frame = CGRectMake(CGRectGetMaxX(self.image_icon.frame) + 15, 15, length_x, 20);
    
    self.lbl_detail.frame = CGRectMake(CGRectGetMaxX(self.lbl_name.frame), 17.5, length_x, 15);
    
    self.view_Line.frame = CGRectMake(CGRectGetMinX(self.lbl_name.frame), 49, SCREEN_WIDTH - CGRectGetMinX(self.lbl_name.frame), 1);
}

@end
